﻿<UserControl x:Class="Zeus.UserControls.TabContral"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:test="clr-namespace:Zeus.UserControls"
   xmlns:nav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
             Width="1024" Height="768">
    
    <UserControl.Resources>
        <Style x:Key="ImageButtonStyle" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <ContentPresenter Content="{TemplateBinding Content}" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    
        
    <Grid x:Name="LayoutRoot" >
        <nav:RadTabControl x:Name="tabControl" Margin="20">
            <nav:RadTabControl.ItemContainerStyle>
                <!--The TabItems are bound and a style is used, but you can create the items in code and set the 
                    properties there.
                 -->
                <Style TargetType="nav:RadTabItem">
                    <!--Set a template for the header:-->
                    <Setter Property="HeaderTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <ContentControl Content="{Binding Title}" Margin="2" VerticalAlignment="Center"/>

                                    <Button Grid.Column="1" Margin="2" Width="12"
                                            Height="12" test:EventHelper.EnableRoutedClick="True"
                                            Style="{StaticResource ImageButtonStyle}">

                                        <Image Source="images/closeButton.png" />

                                    </Button>
                                </Grid>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>

                    <!--Set the template for the content.-->
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Grid>
                                        <ContentControl  Content="{Binding Content}" >
                                            
                                        </ContentControl>
                                    </Grid>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </nav:RadTabControl.ItemContainerStyle>
        </nav:RadTabControl>
    </Grid>
</UserControl>
